import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
class Img extends StatelessWidget {
  final String url;
  final placeholder;
  final BoxFit fit;
  const Img(this.url,{this.placeholder,this.fit=BoxFit.cover});
  @override
  Widget build(BuildContext context) {
    return CachedNetworkImage(
          imageUrl: url,
          fit: fit,
          placeholder: (context, url){
            if(placeholder!=null){
              return placeholder;
            }else{
              return Image.asset("static/images/placeholder.gif");
            }
          },
    );
  }
}